package com.erpanderp.wam.dbmigration.view;


import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

import org.primefaces.context.RequestContext;

import sun.security.pkcs11.Secmod.DbMode;

import com.erpanderp.wam.ac.model.entity.reimbursement.BoardingExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.LodgingExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpenseDetails;
import com.erpanderp.wam.ac.model.entity.reimbursement.TransportExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.TravelExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.TravelMiscExpense;
import com.erpanderp.wam.ac.model.entity.travel.TravelLogistics;
import com.erpanderp.wam.ac.model.entity.travel.TravelRequest;
import com.erpanderp.wam.ac.model.service.travel.LogisticsDAO;
import com.erpanderp.wam.ac.model.service.travel.TravelLogisticsDAO;
import com.erpanderp.wam.dbmigration.model.entity.Employeemaster;
import com.erpanderp.wam.dbmigration.model.entity.FlexDomesticLogistics;
import com.erpanderp.wam.dbmigration.model.entity.FlexExpenseTransportation;
import com.erpanderp.wam.dbmigration.model.entity.FlexEmployeeLeave;
import com.erpanderp.wam.dbmigration.model.entity.FlexExpenseTable;
import com.erpanderp.wam.dbmigration.model.entity.FlexInternationalLogistics;
import com.erpanderp.wam.dbmigration.model.entity.FlexLeaveBalance;
import com.erpanderp.wam.dbmigration.model.entity.FlexLodgingExpense;
import com.erpanderp.wam.dbmigration.model.entity.FlexMiscDetails;
import com.erpanderp.wam.dbmigration.model.entity.FlexMiscMaster;


import com.erpanderp.wam.dbmigration.model.entity.FlexNewJoinee;
import com.erpanderp.wam.dbmigration.model.entity.FlexTravelMaster;
import com.erpanderp.wam.dbmigration.model.entity.FlexTravelMiscExpense;
import com.erpanderp.wam.dbmigration.model.entity.FlexTravelMiscExpenseBoarding;
import com.erpanderp.wam.dbmigration.model.entity.FlexUser;

import com.erpanderp.wam.dbmigration.model.entity.ResourceUtilMaster;
import com.erpanderp.wam.dbmigration.model.service.DataMigrationEngineDAO;
import com.erpanderp.wam.dbmigration.model.service.LeaveMigrationDAO;
import com.erpanderp.wam.dbmigration.model.service.MiscellaneousDAO;
import com.erpanderp.wam.dbmigration.model.service.TravelMasterDAO;
import com.erpanderp.wam.usm.model.entity.leave.EmployeeLeave;
import com.erpanderp.wam.usm.model.entity.leave.LeaveBalance;
import com.erpanderp.wam.usm.model.entity.leave.LeaveType;
import com.erpanderp.wam.usm.model.entity.user.Employee;
import com.erpanderp.wam.usm.model.entity.user.EmployeeAndReporting;
import com.erpanderp.wam.usm.model.entity.user.EmployeeRole;
import com.erpanderp.wam.usm.model.entity.user.NewJoinee;
import com.erpanderp.wam.usm.model.entity.user.WAMUser;
import com.erpanderp.wam.usm.model.service.leave.LeaveTypeDAO;
import com.erpanderp.wam.usm.model.service.user.EmployeeDAO;
import com.erpanderp.wam.util.CommonLookup;
import com.itextpdf.text.log.SysoLogger;

@ManagedBean
@ViewScoped
public class DataMigrationEngineBean {
	private FlexNewJoinee flexNewJoinee = new FlexNewJoinee();
	private DataMigrationEngineDAO dataMigrationDAO = new DataMigrationEngineDAO();
	private NewJoinee newJoinee = new NewJoinee();
	private List<FlexNewJoinee> flexNewJoineesList = new ArrayList<FlexNewJoinee>();
	private List<NewJoinee> newJoineesList = new ArrayList<NewJoinee>();

	private List<Employeemaster> employeeMasters = new ArrayList<Employeemaster>();
	private List<Employee> wamEmployeesList = new ArrayList<Employee>();
	private Employeemaster employeeMaster = new Employeemaster();
	private Employee wamEmployee = new Employee();
	private WAMUser wamUser = new WAMUser();
	private List<WAMUser> wamUsersList = new ArrayList<WAMUser>();

	private ResourceUtilMaster resourceUtilMaster = new ResourceUtilMaster();
	private List<ResourceUtilMaster> resourceUtilMastersList = new ArrayList<ResourceUtilMaster>();
	private EmployeeAndReporting employeeAndReporting = new EmployeeAndReporting();
	private EmployeeRole employeeRole = new EmployeeRole();

	private List<EmployeeAndReporting> employeeAndReportingList = new ArrayList<EmployeeAndReporting>();
	private List<EmployeeRole> employeeRolesList = new ArrayList<EmployeeRole>();

	// LEAVE BALANCE MIGRATION
	private List<FlexLeaveBalance> leaveBalanceList = new ArrayList<FlexLeaveBalance>();
	private FlexLeaveBalance flexLeaveBalance = new FlexLeaveBalance();
	private LeaveMigrationDAO leaveMigrationDAO = new LeaveMigrationDAO();
	private LeaveBalance leaveBalance = new LeaveBalance();
	private LeaveType leaveType = new LeaveType();
	private List<LeaveBalance> wamLeaveBalanceList = new ArrayList<LeaveBalance>();
	private List<LeaveType> leaveTypes = new ArrayList<LeaveType>();
	private LeaveTypeDAO leaveTypeDAO = new LeaveTypeDAO();
	private List<FlexEmployeeLeave> flexEmployeeLeavesList = new ArrayList<FlexEmployeeLeave>();
	private EmployeeLeave wamEmployeeLeave = new EmployeeLeave();
	private List<EmployeeLeave> employeeLeaveList = new ArrayList<EmployeeLeave>();
	private FlexUser flexUser = new FlexUser();
	private List<FlexTravelMaster> flexTravelMasterList = new ArrayList<FlexTravelMaster>();
	private FlexTravelMaster flexTravelMaster = new FlexTravelMaster();
	TravelMasterDAO travelMasterDAO = new TravelMasterDAO();
	private TravelRequest travelRequest = new TravelRequest();
	private List<TravelRequest> wamTravelRequestList = new ArrayList<TravelRequest>();
	private FlexExpenseTable flexExpenseTable = new FlexExpenseTable();
	private TravelExpense travelExpense = new TravelExpense();
	private List<FlexExpenseTable> flexExpensesList = new ArrayList<FlexExpenseTable>();
	private List<TravelExpense> travelExpenseList = new ArrayList<TravelExpense>();
	private LodgingExpense lodgingExpense;
	private FlexLodgingExpense flexLodgingExpense = new FlexLodgingExpense();
	private List<FlexLodgingExpense> flexLodgingExpenseList = new ArrayList<FlexLodgingExpense>();
	private List<LodgingExpense> wamLodgingExpenseList = new ArrayList<LodgingExpense>();
	private TravelMiscExpense travelMiscExpense;
	private List<TravelMiscExpense> travelMiscExpenseList = new ArrayList<TravelMiscExpense>();
	private FlexTravelMiscExpense flexTravelMiscExpense = new FlexTravelMiscExpense();
	private List<FlexTravelMiscExpense> flexTravelMisceExpensesList = new ArrayList<FlexTravelMiscExpense>();
	private FlexTravelMiscExpenseBoarding flexTravelMiscExpenseBoarding;
	private List<FlexTravelMiscExpenseBoarding> flexTravelMiscExpenseBoardingsList = new ArrayList<FlexTravelMiscExpenseBoarding>();
	private BoardingExpense boardingExpense;
	private List<BoardingExpense> wamBoardingExpensesList = new ArrayList<BoardingExpense>();
	private FlexExpenseTransportation felxExpenseTransportaion;
	private List<FlexExpenseTransportation> flexExpenseTransportaionList = new ArrayList<FlexExpenseTransportation>();
	private List<TransportExpense> wamTransportExpenseList = new ArrayList<TransportExpense>();
	private TransportExpense transpportExpense;
	private MiscExpense miscExpense;
	private List<FlexMiscMaster> flexMiscMasterDataList = new ArrayList<FlexMiscMaster>();
	private List<MiscExpense> wamMiscExpenseList = new ArrayList<MiscExpense>();
	private MiscellaneousDAO miscllaneousDAO = new MiscellaneousDAO();
	DateFormat formatter ; 
	private MiscExpenseDetails miscExpenseDetails;
	private List<MiscExpenseDetails> miscExpenseDetailsList = new ArrayList<MiscExpenseDetails>();
	private List<FlexMiscDetails> flexMiscExpenseDetailsList = new ArrayList<FlexMiscDetails>();
	private List<MiscExpenseDetails> wamMiscExpenseDetailsList = new ArrayList<MiscExpenseDetails>();
	
	
	public void copyMiscExpensesDetails() throws ParseException{
		formatter = new SimpleDateFormat("dd/MM/yy");
		flexMiscExpenseDetailsList = miscllaneousDAO.getMiscExpenseDetailsList(); 
		for(FlexMiscDetails flexMiscDetails  : flexMiscExpenseDetailsList){
			miscExpenseDetails = new MiscExpenseDetails();
			miscExpenseDetails.setMiscExpense(miscllaneousDAO.getMiscExpenseByExpenseId(flexMiscDetails.getExpense_Id()));
            miscExpenseDetails.setAmount(Float.valueOf(flexMiscDetails.getAmount_INR().equals("")? String.valueOf(0.00) : flexMiscDetails.getAmount_INR()));
            miscExpenseDetails.setBillAttached(flexMiscDetails.getMisc_Bill_Atch());
            miscExpenseDetails.setBillDate(flexMiscDetails.getDate().equals("") ? null : formatter.parse(flexMiscDetails.getDate()));
            miscExpenseDetails.setBillDesc(flexMiscDetails.getBill_Desc());
            miscExpenseDetails.setBillNo(flexMiscDetails.getBill_No());
            miscExpenseDetails.setStatus("ACTIVE");
            miscExpenseDetails.setCurrency("INR");
            wamMiscExpenseDetailsList.add(miscExpenseDetails);
            
          
		   
		   
			
			
		}
		
		System.out.println("WAM TRANSPORT EXPENSE TRANSPORTATION LIST SIZE IS "+wamMiscExpenseDetailsList.size());
		miscllaneousDAO.createWAMMiscExpensesDetails(wamMiscExpenseDetailsList);
	}
	
	
	public void copyMiscExpenses() throws ParseException{
		formatter = new SimpleDateFormat("dd/MM/yy");
		flexMiscMasterDataList = miscllaneousDAO.getFlexMiscExpenseMasterList(); 
		for(FlexMiscMaster flexMiscMaster  : flexMiscMasterDataList){
			miscExpense = new MiscExpense();
			setMiscExpenseDetails(new MiscExpenseDetails());
            miscExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexMiscMaster.getEmpId()));
            miscExpense.setApprovedBy(new EmployeeDAO().getVP());
            miscExpense.setMiscExpenseCode(flexMiscMaster.getExpense_Id());
            miscExpense.setApprovalComment(flexMiscMaster.getApproval_Comments());
            if(flexMiscMaster.getExpense_Status().equals("Approved")){
             miscExpense.setExpenseStatus("APPROVED");
            }else if(flexMiscMaster.getExpense_Status().equals("Inprocess")){
            	miscExpense.setExpenseStatus("IN PROCESS");
            }else{
            	miscExpense.setExpenseStatus("REJECTED");
            }
            miscExpense.setApprovedCurrency("INR");
            miscExpense.setAdvanceTakenAmount(Float.valueOf(flexMiscMaster.getAdvance_INR().equals("") ? String.valueOf(0.00) : flexMiscMaster.getAdvance_INR()));
            miscExpense.setExpenseLocation(flexMiscMaster.getExpense_Location());
            miscExpense.setExpensePurpose(flexMiscMaster.getExpense_Purpose());
            System.out.println("MISC EXPENSE PURPOSE "+flexMiscMaster.getExpense_Purpose());
            miscExpense.setBalancepayableAmount(Float.valueOf((flexMiscMaster.getBalance_Payable_INR() == null || flexMiscMaster.getBalance_Payable_INR().equals("")) ? String.valueOf(0.00) : flexMiscMaster.getBalance_Payable_INR()));
            miscExpense.setApprovedAmount(Float.valueOf((flexMiscMaster.getApproval_Total_INR() == null || flexMiscMaster.getApproval_Total_INR().equals("")) ? String.valueOf(0.00) : flexMiscMaster.getApproval_Total_INR()));
            miscExpense.setCreateDate(flexMiscMaster.getReq_Date().equals("") ? null : formatter.parse(flexMiscMaster.getReq_Date()));
            miscExpense.setRequestDate(formatter.parse(flexMiscMaster.getReq_Date()));
            miscExpense.setStatus("ACTIVE");
            
		    wamMiscExpenseList.add(miscExpense);
		   
			
			
		}
		System.out.println("WAM TRANSPORT EXPENSE TRANSPORTATION LIST SIZE IS "+wamMiscExpenseList.size());
		miscllaneousDAO.createWAMMiscExpenses(wamMiscExpenseList);
	}
	
	
	
	public void copyTranportExpense(){
		flexExpenseTransportaionList = travelMasterDAO.getFlexExpenseTransportsList();
		for(FlexExpenseTransportation flexExpenseTransportation  :flexExpenseTransportaionList){
			transpportExpense = new TransportExpense();
			transpportExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexExpenseTransportation.getEmpId()));
			transpportExpense.setTravelExpense(travelMasterDAO.getTravelExpenseIByTravelExpenseCode(flexExpenseTransportation.getExpense_Id()));
			transpportExpense.setTransportBillAttached(flexExpenseTransportation.getTrans_Bill_Atch());
			transpportExpense.setTransportAmount(Float.valueOf(flexExpenseTransportation.getTrans_Amount().equals("") ? String.valueOf(0.00): flexExpenseTransportation.getTrans_Amount()));
			transpportExpense.setTransportCurrency(flexExpenseTransportation.getTrans_crcy());
			transpportExpense.setTransportFrom(flexExpenseTransportation.getTrans_From());
			transpportExpense.setTransportTo(flexExpenseTransportation.getTrans_To());
			transpportExpense.setTransportDate(flexExpenseTransportation.getTrans_Date());
			transpportExpense.setTransportMode(flexExpenseTransportation.getTrans_Mode());
			transpportExpense.setTransportStatus(flexExpenseTransportation.getTrans_Status());
			transpportExpense.setStatus("ACTIVE");
		
			wamTransportExpenseList.add(transpportExpense);
			
		}
		System.out.println("WAM TRANSPORT EXPENSE TRANSPORTATION LIST SIZE IS "+wamTransportExpenseList.size());
		travelMasterDAO.createWAMExpenseTransport(wamTransportExpenseList);
	}
	
	
	public void copyTravelMiscExpenseBoarding(){
		flexTravelMiscExpenseBoardingsList = travelMasterDAO.getFlexTravelMiscExpensesBoardings();
		for(FlexTravelMiscExpenseBoarding flexTravelMiscExpenseBoarding  :flexTravelMiscExpenseBoardingsList){
			boardingExpense = new BoardingExpense();
			boardingExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexTravelMiscExpenseBoarding.getEmpId()));
			boardingExpense.setTravelExpense(travelMasterDAO.getTravelExpenseIByTravelExpenseCode(flexTravelMiscExpenseBoarding.getExpense_Id()));
			boardingExpense.setBoardingBillAttached(flexTravelMiscExpenseBoarding.getBoarding_Bill_Atch());
			boardingExpense.setBoardingCurrency(flexTravelMiscExpenseBoarding.getBoarding_Crcy());
			boardingExpense.setBoardingAmount(Float.valueOf(flexTravelMiscExpenseBoarding.getBoarding_Amount().equals("") ? String.valueOf(0.00): flexTravelMiscExpenseBoarding.getBoarding_Amount()));
			boardingExpense.setBoardingHotel(boardingExpense.getBoardingHotel());
			boardingExpense.setBoardingPlace(flexTravelMiscExpenseBoarding.getBoarding_Place());
			boardingExpense.setBoardingStatus(flexTravelMiscExpenseBoarding.getBoarding_Status());
			boardingExpense.setBoardingCurrency(flexTravelMiscExpenseBoarding.getBoarding_Crcy());
			
			boardingExpense.setStatus("ACTIVE");
			wamBoardingExpensesList.add(boardingExpense);
			
		}
		System.out.println("WAM BOARDING LIST IS "+wamBoardingExpensesList.size());
		travelMasterDAO.createWAMTravelBoardingMiscExpenses(wamBoardingExpensesList);
	}
	
	
	public void copyTravelMiscExpense(){
		flexTravelMisceExpensesList = travelMasterDAO.getFlexTravelMiscExpenses();
		for(FlexTravelMiscExpense flexTravelMiscExpense  :flexTravelMisceExpensesList){
			travelMiscExpense = new TravelMiscExpense();
			travelMiscExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexTravelMiscExpense.getEmpId()));
			travelMiscExpense.setTravelExpense(travelMasterDAO.getTravelExpenseIByTravelExpenseCode(flexTravelMiscExpense.getExpense_Id()));
			travelMiscExpense.setBillAttached(flexTravelMiscExpense.getMisc_Bill_Atch());
			travelMiscExpense.setBillDesc(flexTravelMiscExpense.getMisc_Bill_Desc());
			travelMiscExpense.setBillNo(flexTravelMiscExpense.getMisc_Bill_No());
			travelMiscExpense.setExpenseDate(flexTravelMiscExpense.getMisc_Date());
			travelMiscExpense.setExpenseStatus(flexTravelMiscExpense.getMisc_Status());
			travelMiscExpense.setTravelMiscExpenseAmount(Float.valueOf(flexTravelMiscExpense.getMisc_Amount().equals("") ? String.valueOf(0.00) : flexTravelMiscExpense.getMisc_Amount()));
			travelMiscExpense.setTravelMiscExpensecurrency(flexTravelMiscExpense.getMisc_Amount_INR());
			System.out.println(flexTravelMiscExpense.getMisc_Amount_INR());
			travelMiscExpense.setTravelMiscExpenseAmountINR(Float.valueOf(flexTravelMiscExpense.getMisc_Amount_INR() == null || flexTravelMiscExpense.getMisc_Amount_INR().equals("") ? "0.00" : flexTravelMiscExpense.getMisc_Amount_INR()));
			travelMiscExpense.setStatus("ACTIVE");
			travelMiscExpenseList.add(travelMiscExpense);
			
		}
		travelMasterDAO.createWAMTravelMiscExpenses(travelMiscExpenseList);
	}

	public void copyLodgingExpense(){
		flexLodgingExpenseList = travelMasterDAO.getFlexLodigngExpenses();
		System.out.println("FLEX EXPENSES LIST :"+flexExpensesList.size());
		for(FlexLodgingExpense flexLodgingExpense : flexLodgingExpenseList){
			lodgingExpense = new LodgingExpense();
			lodgingExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexLodgingExpense.getEmpId()));
			lodgingExpense.setTravelExpense(travelMasterDAO.getTravelExpenseIByTravelExpenseCode(flexLodgingExpense.getExpense_Id()));
			lodgingExpense.setLodgingAmount(Float.valueOf(flexLodgingExpense.getLodg_Amount().equals("") ? String.valueOf(0.00) : flexLodgingExpense.getLodg_Amount()));
			lodgingExpense.setLodgingCurrency(flexLodgingExpense.getLodg_Crcy());
			lodgingExpense.setLodgingHotel(flexLodgingExpense.getLodg_Hotel());
			lodgingExpense.setLodgingDate(flexLodgingExpense.getLodg_Date());
			lodgingExpense.setLodgingPlace(flexLodgingExpense.getLodg_Place());
			lodgingExpense.setLodgingStatus(flexLodgingExpense.getLodg_Status());
			lodgingExpense.setLodgingBillAttached(flexLodgingExpense.getLodg_Bill_Atch());
			lodgingExpense.setStatus("ACTIVE");
			wamLodgingExpenseList.add(lodgingExpense);
			
			
		}
		
		System.out.println("TRAVEL EXPENSES LIST :"+wamLodgingExpenseList.size());
		travelMasterDAO.createWAMLodgingExpenses(wamLodgingExpenseList);
	}

	
	
	public void copyTravelExpense(){
		flexExpensesList = travelMasterDAO.getFlexExpenses();
		System.out.println("FLEX EXPENSES LIST :"+flexExpensesList.size());
		for(FlexExpenseTable flexExpenseTable : flexExpensesList){
			travelExpense = new TravelExpense();
			travelExpense.setEmployee(dataMigrationDAO.getRegularEmployeeByEmployeeId(flexExpenseTable.getEmpId()));
			travelExpense.setTravelRequest(travelMasterDAO.getTraveRequestByTravelRequestId(flexExpenseTable.getTravel_Id()));
			travelExpense.setAdvanceTaken(Float.valueOf((flexExpenseTable.getAdvance_Taken_Value().equals("") ? String.valueOf(0.00) : flexExpenseTable.getAdvance_Taken_Value())));
			travelExpense.setRequestDate(flexExpenseTable.getReq_Date());
			travelExpense.setRecommenderBy(dataMigrationDAO.getEmployeeByFlexEmployeeName(flexExpenseTable.getRecommended_By()));
			travelExpense.setApprovedBy(dataMigrationDAO.getEmployeeByFlexEmployeeName(flexExpenseTable.getApproved_By()));
			travelExpense.setApprovalComments(flexExpenseTable.getApproval_Comments());
			travelExpense.setApprovalTotalINR(Float.valueOf(flexExpenseTable.getTotal_INR().equals("") ? String.valueOf(0.00) : flexExpenseTable.getTotal_INR()));
			travelExpense.setApprovalTotalCurrency(flexExpenseTable.getApproval_Total_Currency());
			travelExpense.setRecommenderComments(flexExpenseTable.getRecommender_Status());
            travelExpense.setRecommenderStatus(flexExpenseTable.getRecommender_Status());
            travelExpense.setApproverStatus(flexExpenseTable.getApprover_Status());
            travelExpense.setAdvancetakenCurrency(flexExpenseTable.getAdvance_Taken_Crny());
            travelExpense.setSummaryAED(Float.valueOf((flexExpenseTable.getTotal_AED().equals("") ? String.valueOf(0.00) :flexExpenseTable.getTotal_AED())));
            travelExpense.setExpenseSummaryINR(Float.valueOf((flexExpenseTable.getTotal_INR().equals("") ?String.valueOf(0.00): flexExpenseTable.getTotal_INR())));
            travelExpense.setTravelExpenseCode(flexExpenseTable.getExpense_Id());
            travelExpense.setCreateDate(flexExpenseTable.getReq_Date());
            travelExpense.setSummaryDOLLAR(Float.valueOf((flexExpenseTable.getTotal_USD().equals("") ? String.valueOf(0.00) : flexExpenseTable.getTotal_USD())));
            travelExpense.setTransRestatus(flexExpenseTable.getTrans_Restatus());
            travelExpense.setStatus("ACTIVE");
			travelExpenseList.add(travelExpense);
			
		}
		System.out.println("TRAVEL EXPENSES LIST :"+travelExpenseList.size());
		travelMasterDAO.createWAMTravelExpenses(travelExpenseList);
	}

	public void copyTravelMaster() {
		flexTravelMasterList = travelMasterDAO.getFlexTravelMaster();
		for (FlexTravelMaster flexTravelMaster : flexTravelMasterList) {
			travelRequest = new TravelRequest();
			travelRequest.setTravelRequestCode(flexTravelMaster.getTravel_Id());
			travelRequest
					.setEmployee(dataMigrationDAO
							.getRegularEmployeeByEmployeeId(flexTravelMaster
									.getEmpId()));
			travelRequest.setApprover(dataMigrationDAO
					.getEmployeeByFlexEmployeeName(flexTravelMaster
							.getApproved_By()));
			travelRequest.setApprovalComments(flexTravelMaster
					.getApproval_Comments());
			travelRequest.setAdvancePaymentINR(Float
					.valueOf((String) (flexTravelMaster.getAdv_Payment()
							.equals("") ? String.valueOf(0.00)
							: flexTravelMaster.getAdv_Payment())));
			travelRequest.setCancellationReason(flexTravelMaster
					.getReason_Cancel());
			travelRequest.setClient(flexTravelMaster.getClient());
			travelRequest.setClientLocation(flexTravelMaster.getLocation());
			travelRequest.setEmergencyContact(flexTravelMaster.getEmp_Emrg());
			travelRequest.setNatureOfWork(flexTravelMaster.getNature_Work());
			travelRequest.setPeriodFrom(flexTravelMaster.getSt_Date());
			travelRequest.setPeriodTo(flexTravelMaster.getRtn_Date());
			travelRequest.setTravelFrom_DO(flexTravelMaster.getTr_From());
			travelRequest.setTravelTo_DO(flexTravelMaster.getTr_To());
			travelRequest.setTravelFrom_OS(flexTravelMaster.getO_Tr_From());
			travelRequest.setTravelTo_OS(flexTravelMaster.getO_Tr_To());
			travelRequest.setRequestDate(flexTravelMaster.getTr_Rq_Date());
			travelRequest.setTravelFromCountry_DO(flexTravelMaster
					.getTrvl_From_County());
			travelRequest.setTravelToCountry_DO(flexTravelMaster
					.getTrvl_To_Country());
			travelRequest.setTravelFromCountry_OS(flexTravelMaster
					.getOtrvl_From_Country());
			travelRequest.setTravelToCountry_OS(flexTravelMaster
					.getOtrvl_To_Country());
			travelRequest.setTravelMode(flexTravelMaster.getTravel_Mode());
			travelRequest.setTravelStatus(flexTravelMaster.getTravel_Status());
			travelRequest.setTravelMode(flexTravelMaster.getTravel_Mode());
			travelRequest.setTravelType(flexTravelMaster.getTrip_mode());
			wamTravelRequestList.add(travelRequest);
		}

		travelMasterDAO.createWamTravelRequests(wamTravelRequestList);
	}

	public void copyFlexEmployeeLeave(ActionEvent e) {
		flexEmployeeLeavesList = leaveMigrationDAO.getFlexEmployeeLeaves();
		for (FlexEmployeeLeave flexEmployeeLeave : flexEmployeeLeavesList) {
			
			Employee requester = dataMigrationDAO
					.getRegularEmployeeByEmployeeId(flexEmployeeLeave
							.getEmpId());
			Employee approver = dataMigrationDAO
					.getEmployeeByFlexEmployeeName(flexEmployeeLeave
							.getSupervisor());
			
			if(requester != null && approver != null){
				wamEmployeeLeave = new EmployeeLeave();
				wamEmployeeLeave.setLeaveType(leaveMigrationDAO
						.getLeaveTypeByLeaveName(flexEmployeeLeave.getLeavetype()));
				wamEmployeeLeave
						.setAppliedOn(flexEmployeeLeave.getLeaveappliedon());
				wamEmployeeLeave.setEmployee(requester);
				wamEmployeeLeave.setApprovalComments(flexEmployeeLeave
						.getApproverComments());
				wamEmployeeLeave.setReason(flexEmployeeLeave.getReason());
				if (flexEmployeeLeave.getApprove().equals("yes")) {
					wamEmployeeLeave
							.setApprovalStatus(CommonLookup.LEAVE_APPROVED_STATUS);
				} else if (flexEmployeeLeave.getApprove().equals("no")) {
					wamEmployeeLeave
							.setApprovalStatus(CommonLookup.LEAVE_REJECT_STATUS);
				} else if (flexEmployeeLeave.getApprove().equals("Inprocess")) {
					wamEmployeeLeave
							.setApprovalStatus(CommonLookup.LEAVE_INPROCESS_STATUS);
				} else if (flexEmployeeLeave.getApprove().equals("Cancelled")) {
					wamEmployeeLeave
							.setCancellationStatus(CommonLookup.LEAVE_CANCELLATION_ACCEPTED_STATUS);
				} else {
					wamEmployeeLeave
							.setCancellationStatus(CommonLookup.LEAVE_CANCELLATION__MYSELF_STATUS);
				}
	
				
				wamEmployeeLeave.setLeaveCode(flexEmployeeLeave.getLeaveId());
				wamEmployeeLeave.setAvailableAddress(flexEmployeeLeave
						.getAvailableAddress());
				wamEmployeeLeave.setAvailableContactNumber(flexEmployeeLeave
						.getAvailableContactnumber());
				wamEmployeeLeave.setPeriodFrom(flexEmployeeLeave.getLeavefrom());
				wamEmployeeLeave.setPeriodTo(flexEmployeeLeave.getLeaveto());
				wamEmployeeLeave.setNoOfDays(daysBetween(wamEmployeeLeave.getPeriodTo(), wamEmployeeLeave.getPeriodFrom()));
				wamEmployeeLeave.setReasonForCancel(flexEmployeeLeave
						.getReason_Leave_cancel());
				wamEmployeeLeave.setApprover(approver);
				employeeLeaveList.add(wamEmployeeLeave);	
			}
			
		}
		System.out.println("EMPLOYEE LEAVES MIGRATION LIST---------------> "
				+ employeeLeaveList.size());
		leaveMigrationDAO.createWAMEmployeeLeaves(employeeLeaveList);

	}
	
	public long daysBetween(Date max, Date min)
	{
	 return ((max.getTime() - min.getTime())/86400000)+1;
	}

	public void copyFlexNewJoinee(ActionEvent e) {
		System.out.println("IN COPY FLEX NEW JOINEE");

		flexNewJoineesList = dataMigrationDAO.getFlexNewJoinee();
		System.out.println("FLEX NEW JOINEES LIST SIZE "
				+ flexNewJoineesList.size());
		for (FlexNewJoinee flexNewJoinee : flexNewJoineesList) {
			newJoinee = new NewJoinee();
			newJoinee.setFirstName(flexNewJoinee.getFirst_Name());
			newJoinee.setLastName(flexNewJoinee.getLast_Name());
			newJoinee.setGender(flexNewJoinee.getGender());
			// newJoinee.setDateofbirth(flexNewJoinee.getDOB());
			newJoinee.setCitizenship(flexNewJoinee.getCitizenship());
			newJoinee.setBirthPlace(flexNewJoinee.getPlace_Birth());
			newJoinee.setAlternateEmail(flexNewJoinee.getAltr_Email());
			newJoinee.setCurrentAddress(flexNewJoinee.getCurrent_Addrs());
			// newJoinee.setDateOfJoining(flexNewJoinee.getDateofJoin());
			newJoinee.setEmployeeId(flexNewJoinee.getEmpId());
			newJoinee.setNationality(flexNewJoinee.getNationality());
			newJoinee.setPrimarySkill(flexNewJoinee.getPrim_Skill());
			newJoinee.setTelephone(flexNewJoinee.getContactNo());
			newJoinee.setEmail(flexNewJoinee.getPrsnl_Email());
			newJoinee.setFathername(flexNewJoinee.getFath_Name());
			newJoinee.setMaidenname(flexNewJoinee.getMaiden_Name());
			newJoinee.setMotherName(flexNewJoinee.getMoth_Name());
			newJoinee.setMothermaidenName(flexNewJoinee.getMoth_Maiden());
			newJoinee.setCreateDate(new Date());
			newJoinee.setCreatedBy(flexNewJoinee.getFirst_Name());
			newJoinee.setStatus("ACTIVE");
			// newJoinee.getPassportAndPANDetails().add(e);
			newJoineesList.add(newJoinee);
			// dataMigrationDAO.creatWamNewJoinee(newJoineesList);
		}
		System.out.println("NEW JOINEES LIST SIZE " + newJoineesList.size());
		// dataMigrationDAO.creatWamNewJoinee(newJoineesList);
	}

	public void copyFlexEmployeeMaster(ActionEvent e) {
		System.out.println("IN COPY FLEX EMPLOYEE MASTER");

		try {

			employeeMasters = dataMigrationDAO.getFlexEmployeeMasters();
			System.out.println("EMPLOYEE MASTERS LIST SIZE "
					+ employeeMasters.size());
			for (Employeemaster employeeMaster : employeeMasters) {

				wamEmployee = new Employee();
				wamUser = new WAMUser();
				wamEmployee.setFirstName(employeeMaster.getFirstName());
				wamEmployee.setLastName(employeeMaster.getLastName());
				wamEmployee.setEmployeeCode(employeeMaster.getEmpId());
				wamEmployee.setModuleName(employeeMaster.getModuleName());
				wamEmployee.setAuthentication(employeeMaster
						.getAuthentication());
				wamEmployee.setDesignation(employeeMaster.getDesignation());
				wamEmployee.setPrimarySkill(employeeMaster.getPrimarySkill());
				wamEmployee.setSecondarySkill(employeeMaster
						.getSecondarySkill());
				wamEmployee.setEmail(employeeMaster.getEmail());
				wamEmployee.setTelephone(employeeMaster.getContactNo());
				wamEmployee.setLocation(employeeMaster.getLocation());
				wamEmployee.setRelieved(employeeMaster.getRelieved());
				wamEmployee.setDateOfBirth(employeeMaster.getDob());
				// wamEmployee.setDateOfJoining(employeeMaster.get)
				// newJoinee.setDateofbirth(flexNewJoinee.getDOB());
				wamEmployee.setStatus("ACTIVE");
				flexUser = new DataMigrationEngineDAO().getFlexUser(wamEmployee
						.getEmployeeCode());
				wamUser.setEmployeeCode(employeeMaster.getEmpId());
				wamUser.setPassword(flexUser == null ? null : flexUser
						.getPassword());
				wamEmployee.getWAMUsers().add(wamUser);

				wamEmployeesList.add(wamEmployee);

			}

			dataMigrationDAO.creatWamEmployeeAndWamUser(wamEmployeesList);
			System.out.println("WAM EMPLOYEES LIST SIZE "
					+ wamEmployeesList.size());
			System.out
					.println("WAM USERS LIST SIZE " + wamEmployeesList.size());
			FacesContext.getCurrentInstance().addMessage(
					"",
					new FacesMessage(FacesMessage.SEVERITY_INFO,
							"Employee details and credentials migrated.", ""));
		} catch (Exception ex) {
			FacesContext
					.getCurrentInstance()
					.addMessage(
							"",
							new FacesMessage(
									FacesMessage.SEVERITY_ERROR,
									"Employee details and credentials migration failed.",
									ex.getMessage()));
		}

	}

	public void copyResourceUtilMasters(ActionEvent a) {
		resourceUtilMastersList = new ArrayList<ResourceUtilMaster>();
		resourceUtilMastersList = dataMigrationDAO.getResourceUtilMasters();
		for (ResourceUtilMaster resourceUtilMaster : resourceUtilMastersList) {
			System.out.println(resourceUtilMaster.getEmpId());
			employeeAndReporting = new EmployeeAndReporting();
			Employee employee = dataMigrationDAO
					.getRegularEmployeeByEmployeeId(resourceUtilMaster
							.getEmpId());
			if (employee != null) {
				employeeAndReporting.setCompetencelead(dataMigrationDAO
						.getCompetencyLeadByEmployeeId(resourceUtilMaster
								.getCl_Id()));
				employeeAndReporting.setCenterHead(dataMigrationDAO
						.getCenterHeadByEmployeeId(resourceUtilMaster
								.getCh_Id()));
				employeeAndReporting.setProjectManager(dataMigrationDAO
						.getProjectManagerByEmployeeId(resourceUtilMaster
								.getPm_Id()));
				employeeAndReporting.setEmployee(employee);
				employeeAndReportingList.add(employeeAndReporting);
			}
		}
		if (employeeAndReportingList != null
				&& employeeAndReportingList.size() > 0) {
			dataMigrationDAO
					.createEmployeeAndReporting(employeeAndReportingList);
			FacesContext.getCurrentInstance().addMessage(
					"",
					new FacesMessage(FacesMessage.SEVERITY_INFO,
							"Employee reporting details migrated.", ""));
		} else {
			FacesContext
					.getCurrentInstance()
					.addMessage(
							"",
							new FacesMessage(
									FacesMessage.SEVERITY_ERROR,
									"Employee reporting details migration failed.",
									""));
		}

	}

	public void copyLeaveBalance() {
		leaveBalanceList = leaveMigrationDAO.getFlexLeaveBalances();
		System.out.println("FLEX EMPLOYEES LEAVE BALANCES SIZE :"
				+ leaveBalanceList.size());

		for (FlexLeaveBalance flexLeaveBalance : leaveBalanceList) {
			System.out.println("FLEX LEAVE BALANCE FOR LOOP");

			wamEmployee = dataMigrationDAO
					.getRegularEmployeeByEmployeeId(flexLeaveBalance
							.getEmpId());
			
			if(wamEmployee != null){
			
				leaveTypes = leaveTypeDAO.getLeaveTypes();
				for (LeaveType wamleaveType : leaveTypes) {
					System.out.println("WAM LEAVE TYPES FOR LOOP------->");
					leaveBalance = new LeaveBalance();
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.SICKLEAVE_TYPE)) {
						System.out.println("LEAVE TYPE ==================== "
								+ leaveType.getLeaveType());
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getSLbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.CASUALLEAVE_TYPE)) {
				
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getCLbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.PRIVILIZEDLEAVE_TYPE)) {
				
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getPLbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.OPTIONALLEAVE_TYPE)) {
				
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getOHbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.WORKFROMHOME_TYPE)) {
				
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getOHbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
					
					if (wamleaveType.getLeaveType().equals(
							CommonLookup.LOSS_OF_PAY_TYPE)) {
						wamEmployee = dataMigrationDAO
								.getRegularEmployeeByEmployeeId(flexLeaveBalance
										.getEmpId());
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(flexLeaveBalance.getLOPbal());
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}if (wamleaveType.getLeaveType().equals(
							CommonLookup.COMP_OF_TYPE)) {
						System.out.println("COMP OFF LEAVE TYPE--------------------------------------");
						wamEmployee = dataMigrationDAO
								.getRegularEmployeeByEmployeeId(flexLeaveBalance
										.getEmpId());
						leaveBalance.setEmployee(wamEmployee);
						leaveBalance.setBalance(0F);
						leaveBalance.setLeaveType(wamleaveType);
						wamLeaveBalanceList.add(leaveBalance);
					}
				
				}
			}		

		}

		System.out.println("WAM EMPLOYEES LEAVE BALANCES SIZE :"
				+ wamLeaveBalanceList.size());
		leaveMigrationDAO.createWamEmployeeLeaveBalances(wamLeaveBalanceList);
	}

	public void copyTravelLogistics() {
		List<FlexDomesticLogistics> flexDomesticLogistics = travelMasterDAO.getDomesticLogistics();
		List<FlexInternationalLogistics> flexInternationalLogistics = travelMasterDAO.getInternationalLogistics();
		List<TravelLogistics> travelLogistics = new ArrayList<TravelLogistics>();
		Date now = new Date();
		LogisticsDAO logisticsDAO = new LogisticsDAO();
		for(FlexDomesticLogistics domesticLogistics : flexDomesticLogistics){
			TravelLogistics logistics = new TravelLogistics();
			System.out.println(domesticLogistics.getTravel_Id());
			TravelRequest travelRequest = travelMasterDAO.getTraveRequestByTravelRequestId(domesticLogistics.getTravel_Id());
			logistics.setTravelRequest(travelRequest);
			
			logistics.setByWhom(domesticLogistics.getBy_Client().equals("Yes") ? "Client" : "ERPandERP");
			logistics.setCreateDate(now);
			logistics.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
			logistics.setLogistics(logisticsDAO.getLogistics(domesticLogistics.getLogistic()));
			logistics.setStatus(CommonLookup.STATUS_ACTIVE);
			travelLogistics.add(logistics);
		}
		
		for(FlexInternationalLogistics domesticLogistics : flexInternationalLogistics){
			System.out.println(domesticLogistics.getTravel_Id());
			TravelLogistics logistics = new TravelLogistics();
			TravelRequest travelRequest = travelMasterDAO.getTraveRequestByTravelRequestId(domesticLogistics.getTravel_Id());
			logistics.setTravelRequest(travelRequest);
			logistics.setByWhom(domesticLogistics.getBy_Client().equals("Yes") ? "Client" : "ERPandERP");
			logistics.setCreateDate(now);
			logistics.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
			logistics.setLogistics(logisticsDAO.getLogistics(domesticLogistics.getLogistic()));
			logistics.setStatus(CommonLookup.STATUS_ACTIVE);
			travelLogistics.add(logistics);
		}
		
		TravelLogisticsDAO travelLogisticsDAO = new TravelLogisticsDAO();
		travelLogisticsDAO.saveTravelLogistics(travelLogistics);
	}
	public FlexNewJoinee getFlexNewJoinee() {
		return flexNewJoinee;
	}

	public void setFlexNewJoinee(FlexNewJoinee flexNewJoinee) {
		this.flexNewJoinee = flexNewJoinee;
	}

	public NewJoinee getNewJoinee() {
		return newJoinee;
	}

	public void setNewJoinee(NewJoinee newJoinee) {
		this.newJoinee = newJoinee;
	}

	public List<FlexNewJoinee> getFlexNewJoineesList() {
		return flexNewJoineesList;
	}

	public void setFlexNewJoineesList(List<FlexNewJoinee> flexNewJoineesList) {
		this.flexNewJoineesList = flexNewJoineesList;
	}

	public List<NewJoinee> getNewJoineesList() {
		return newJoineesList;
	}

	public void setNewJoineesList(List<NewJoinee> newJoineesList) {
		this.newJoineesList = newJoineesList;
	}

	public List<Employeemaster> getEmployeeMasters() {
		return employeeMasters;
	}

	public void setEmployeeMasters(List<Employeemaster> employeeMasters) {
		this.employeeMasters = employeeMasters;
	}

	public List<Employee> getWamEmployeesList() {
		return wamEmployeesList;
	}

	public void setWamEmployeesList(List<Employee> wamEmployeesList) {
		this.wamEmployeesList = wamEmployeesList;
	}

	public Employeemaster getEmployeeMaster() {
		return employeeMaster;
	}

	public void setEmployeeMaster(Employeemaster employeeMaster) {
		this.employeeMaster = employeeMaster;
	}

	public Employee getWamEmployee() {
		return wamEmployee;
	}

	public void setWamEmployee(Employee wamEmployee) {
		this.wamEmployee = wamEmployee;
	}

	public WAMUser getWamUser() {
		return wamUser;
	}

	public void setWamUser(WAMUser wamUser) {
		this.wamUser = wamUser;
	}

	public List<WAMUser> getWamUsersList() {
		return wamUsersList;
	}

	public void setWamUsersList(List<WAMUser> wamUsersList) {
		this.wamUsersList = wamUsersList;
	}

	public EmployeeAndReporting getEmployeeAndReporting() {
		return employeeAndReporting;
	}

	public void setEmployeeAndReporting(
			EmployeeAndReporting employeeAndReporting) {
		this.employeeAndReporting = employeeAndReporting;
	}

	public EmployeeRole getEmployeeRole() {
		return employeeRole;
	}

	public void setEmployeeRole(EmployeeRole employeeRole) {
		this.employeeRole = employeeRole;
	}

	public List<EmployeeAndReporting> getEmployeeAndReportingList() {
		return employeeAndReportingList;
	}

	public void setEmployeeAndReportingList(
			List<EmployeeAndReporting> employeeAndReportingList) {
		this.employeeAndReportingList = employeeAndReportingList;
	}

	public List<EmployeeRole> getEmployeeRolesList() {
		return employeeRolesList;
	}

	public void setEmployeeRolesList(List<EmployeeRole> employeeRolesList) {
		this.employeeRolesList = employeeRolesList;
	}

	public List<ResourceUtilMaster> getResourceUtilMastersList() {
		return resourceUtilMastersList;
	}

	public void setResourceUtilMastersList(
			List<ResourceUtilMaster> resourceUtilMastersList) {
		this.resourceUtilMastersList = resourceUtilMastersList;
	}

	public ResourceUtilMaster getResourceUtilMaster() {
		return resourceUtilMaster;
	}

	public void setResourceUtilMaster(ResourceUtilMaster resourceUtilMaster) {
		this.resourceUtilMaster = resourceUtilMaster;
	}

	public List<FlexLeaveBalance> getLeaveBalanceList() {
		return leaveBalanceList;
	}

	public void setLeaveBalanceList(List<FlexLeaveBalance> leaveBalanceList) {
		this.leaveBalanceList = leaveBalanceList;
	}

	public FlexLeaveBalance getFlexLeaveBalance() {
		return flexLeaveBalance;
	}

	public void setFlexLeaveBalance(FlexLeaveBalance flexLeaveBalance) {
		this.flexLeaveBalance = flexLeaveBalance;
	}

	public LeaveBalance getLeaveBalance() {
		return leaveBalance;
	}

	public void setLeaveBalance(LeaveBalance leaveBalance) {
		this.leaveBalance = leaveBalance;
	}

	public LeaveType getLeaveType() {
		return leaveType;
	}

	public void setLeaveType(LeaveType leaveType) {
		this.leaveType = leaveType;
	}

	public List<LeaveType> getLeaveTypes() {
		return leaveTypes;
	}

	public void setLeaveTypes(List<LeaveType> leaveTypes) {
		this.leaveTypes = leaveTypes;
	}

	public List<FlexEmployeeLeave> getFlexEmployeeLeavesList() {
		return flexEmployeeLeavesList;
	}

	public void setFlexEmployeeLeavesList(
			List<FlexEmployeeLeave> flexEmployeeLeavesList) {
		this.flexEmployeeLeavesList = flexEmployeeLeavesList;
	}

	public EmployeeLeave getWamEmployeeLeave() {
		return wamEmployeeLeave;
	}

	public void setWamEmployeeLeave(EmployeeLeave wamEmployeeLeave) {
		this.wamEmployeeLeave = wamEmployeeLeave;
	}

	public List<EmployeeLeave> getEmployeeLeaveList() {
		return employeeLeaveList;
	}

	public void setEmployeeLeaveList(List<EmployeeLeave> employeeLeaveList) {
		this.employeeLeaveList = employeeLeaveList;
	}

	public FlexUser getFlexUser() {
		return flexUser;
	}

	public void setFlexUser(FlexUser flexUser) {
		this.flexUser = flexUser;
	}

	public List<FlexTravelMaster> getFlexTravelMasterList() {
		return flexTravelMasterList;
	}

	public void setFlexTravelMasterList(
			List<FlexTravelMaster> flexTravelMasterList) {
		this.flexTravelMasterList = flexTravelMasterList;
	}

	public FlexTravelMaster getFlexTravelMaster() {
		return flexTravelMaster;
	}

	public void setFlexTravelMaster(FlexTravelMaster flexTravelMaster) {
		this.flexTravelMaster = flexTravelMaster;
	}

	public TravelRequest getTravelRequest() {
		return travelRequest;
	}

	public void setTravelRequest(TravelRequest travelRequest) {
		this.travelRequest = travelRequest;
	}

	public List<TravelRequest> getWamTravelRequestList() {
		return wamTravelRequestList;
	}

	public void setWamTravelRequestList(List<TravelRequest> wamTravelRequestList) {
		this.wamTravelRequestList = wamTravelRequestList;
	}

	public FlexExpenseTable getFlexExpenseTable() {
		return flexExpenseTable;
	}

	public void setFlexExpenseTable(FlexExpenseTable flexExpenseTable) {
		this.flexExpenseTable = flexExpenseTable;
	}

	public TravelExpense getTravelExpense() {
		return travelExpense;
	}

	public void setTravelExpense(TravelExpense travelExpense) {
		this.travelExpense = travelExpense;
	}

	public List<FlexExpenseTable> getFlexExpensesList() {
		return flexExpensesList;
	}

	public void setFlexExpensesList(List<FlexExpenseTable> flexExpensesList) {
		this.flexExpensesList = flexExpensesList;
	}

	public List<TravelExpense> getTravelExpenseList() {
		return travelExpenseList;
	}

	public void setTravelExpenseList(List<TravelExpense> travelExpenseList) {
		this.travelExpenseList = travelExpenseList;
	}



	public LodgingExpense getLodgingExpense() {
		return lodgingExpense;
	}



	public void setLodgingExpense(LodgingExpense lodgingExpense) {
		this.lodgingExpense = lodgingExpense;
	}



	public FlexLodgingExpense getFlexLodgingExpense() {
		return flexLodgingExpense;
	}



	public void setFlexLodgingExpense(FlexLodgingExpense flexLodgingExpense) {
		this.flexLodgingExpense = flexLodgingExpense;
	}



	public List<FlexLodgingExpense> getFlexLodgingExpenseList() {
		return flexLodgingExpenseList;
	}



	public void setFlexLodgingExpenseList(List<FlexLodgingExpense> flexLodgingExpenseList) {
		this.flexLodgingExpenseList = flexLodgingExpenseList;
	}



	public List<LodgingExpense> getWamLodgingExpenseList() {
		return wamLodgingExpenseList;
	}



	public void setWamLodgingExpenseList(List<LodgingExpense> wamLodgingExpenseList) {
		this.wamLodgingExpenseList = wamLodgingExpenseList;
	}



	public TravelMiscExpense getTravelMiscExpense() {
		return travelMiscExpense;
	}



	public void setTravelMiscExpense(TravelMiscExpense travelMiscExpense) {
		this.travelMiscExpense = travelMiscExpense;
	}



	public List<TravelMiscExpense> getTravelMiscExpenseList() {
		return travelMiscExpenseList;
	}



	public void setTravelMiscExpenseList(List<TravelMiscExpense> travelMiscExpenseList) {
		this.travelMiscExpenseList = travelMiscExpenseList;
	}



	public FlexTravelMiscExpense getFlexTravelMiscExpense() {
		return flexTravelMiscExpense;
	}



	public void setFlexTravelMiscExpense(FlexTravelMiscExpense flexTravelMiscExpense) {
		this.flexTravelMiscExpense = flexTravelMiscExpense;
	}



	public List<FlexTravelMiscExpense> getFlexTravelMisceExpensesList() {
		return flexTravelMisceExpensesList;
	}



	public void setFlexTravelMisceExpensesList(
			List<FlexTravelMiscExpense> flexTravelMisceExpensesList) {
		this.flexTravelMisceExpensesList = flexTravelMisceExpensesList;
	}


	public FlexTravelMiscExpenseBoarding getFlexTravelMiscExpenseBoarding() {
		return flexTravelMiscExpenseBoarding;
	}


	public void setFlexTravelMiscExpenseBoarding(
			FlexTravelMiscExpenseBoarding flexTravelMiscExpenseBoarding) {
		this.flexTravelMiscExpenseBoarding = flexTravelMiscExpenseBoarding;
	}


	public List<FlexTravelMiscExpenseBoarding> getFlexTravelMiscExpenseBoardingsList() {
		return flexTravelMiscExpenseBoardingsList;
	}


	public void setFlexTravelMiscExpenseBoardingsList(
			List<FlexTravelMiscExpenseBoarding> flexTravelMiscExpenseBoardingsList) {
		this.flexTravelMiscExpenseBoardingsList = flexTravelMiscExpenseBoardingsList;
	}


	public BoardingExpense getBoardingExpense() {
		return boardingExpense;
	}


	public void setBoardingExpense(BoardingExpense boardingExpense) {
		this.boardingExpense = boardingExpense;
	}


	public List<BoardingExpense> getWamBoardingExpensesList() {
		return wamBoardingExpensesList;
	}


	public void setWamBoardingExpensesList(List<BoardingExpense> wamBoardingExpensesList) {
		this.wamBoardingExpensesList = wamBoardingExpensesList;
	}


	public FlexExpenseTransportation getFelxExpenseTransportaion() {
		return felxExpenseTransportaion;
	}


	public void setFelxExpenseTransportaion(FlexExpenseTransportation felxExpenseTransportaion) {
		this.felxExpenseTransportaion = felxExpenseTransportaion;
	}


	public List<FlexExpenseTransportation> getFlexExpenseTransportaionList() {
		return flexExpenseTransportaionList;
	}


	public void setFlexExpenseTransportaionList(
			List<FlexExpenseTransportation> flexExpenseTransportaionList) {
		this.flexExpenseTransportaionList = flexExpenseTransportaionList;
	}


	public List<TransportExpense> getWamTransportExpenseList() {
		return wamTransportExpenseList;
	}


	public void setWamTransportExpenseList(List<TransportExpense> wamTransportExpenseList) {
		this.wamTransportExpenseList = wamTransportExpenseList;
	}


	public MiscExpense getMiscExpense() {
		return miscExpense;
	}


	public void setMiscExpense(MiscExpense miscExpense) {
		this.miscExpense = miscExpense;
	}


	public List<MiscExpense> getWamMiscExpenseList() {
		return wamMiscExpenseList;
	}


	public void setWamMiscExpenseList(List<MiscExpense> wamMiscExpenseList) {
		this.wamMiscExpenseList = wamMiscExpenseList;
	}


	public List<FlexMiscMaster> getFlexMiscMasterDataList() {
		return flexMiscMasterDataList;
	}


	public void setFlexMiscMasterDataList(
			List<FlexMiscMaster> flexMiscMasterDataList) {
		this.flexMiscMasterDataList = flexMiscMasterDataList;
	}


	public MiscExpenseDetails getMiscExpenseDetails() {
		return miscExpenseDetails;
	}


	public void setMiscExpenseDetails(MiscExpenseDetails miscExpenseDetails) {
		this.miscExpenseDetails = miscExpenseDetails;
	}


	public List<MiscExpenseDetails> getMiscExpenseDetailsList() {
		return miscExpenseDetailsList;
	}


	public void setMiscExpenseDetailsList(List<MiscExpenseDetails> miscExpenseDetailsList) {
		this.miscExpenseDetailsList = miscExpenseDetailsList;
	}


	public List<FlexMiscDetails> getFlexMiscExpenseDetailsList() {
		return flexMiscExpenseDetailsList;
	}


	public void setFlexMiscExpenseDetailsList(
			List<FlexMiscDetails> flexMiscExpenseDetailsList) {
		this.flexMiscExpenseDetailsList = flexMiscExpenseDetailsList;
	}


	public List<MiscExpenseDetails> getWamMiscExpenseDetailsList() {
		return wamMiscExpenseDetailsList;
	}


	public void setWamMiscExpenseDetailsList(
			List<MiscExpenseDetails> wamMiscExpenseDetailsList) {
		this.wamMiscExpenseDetailsList = wamMiscExpenseDetailsList;
	}

}
